<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户在h1元素上点击时会改变其内容</title>
</head>

<body>
    <h1 onclick="this.innerHTML='Ooops!'">点击文本!</h1>
</body>

</html>